﻿package org.leles.engines.beatgame 
{
	import flash.events.Event;
	
	/**
	 * ...
	 * @author Bruno Leles
	 */
	public class BeatGameEvent extends Event 
	{
		
		public static const GAME_START:String				= "GAME_START";
		public static const GAME_LOOP:String				= "GAME_LOOP";
		public static const GAME_OVER:String				= "GAME_OVER";
		
		//public static const SONG_STARTED:String			= "SONG_STARTED";
		//public static const SONG_COMPLETED:String			= "SONG_COMPLETED";
		
		public static const NOTE_LEAVED_OFFSET:String		= "NOTE_LEAVED_OFFSET";
		public static const NOTE_ENTERED_OFFSET:String		= "NOTE_ENTERED_OFFSET";
		public static const NOTE_HIT:String 				= "NOTE_HIT";
		public static const NOTE_MISS:String 				= "NOTE_MISS";
		public static const NOTE_LOST:String 				= "NOTE_LOST";
		
		public static const CURRENT_COMBO_INCREASED:String 	= "CURRENT_COMBO_INCREASED";
		public static const NEW_MAX_COMBO:String 			= "NEW_MAX_COMBO";
		public static const UPDATE_LINEAR_PONTUATION:String = "UPDATE_LINEAR_PONTUATION";
		//public static const NOTE_WAS_HIT:String 			= "NOTE_WAS_HIT";
		//public static const NOTE_WAS_LOST:String			= "NOTE_WAS_LOST";
		//public static const NOTE_HOLD:String				= "NOTE_HOLD";
		//public static const NOTE_RELEASE:String			= "NOTE_RELEASE";
		
		public static const TRACK_HOLD:String			= "TRACK_HOLD";
		public static const TRACK_RELEASE:String		= "TRACK_RELEASE";
		
		public var engine:BeatGameEngine;
		public var song:BeatGameSong;
		public var note:BeatGameNote;
		public var hitTimeDelta:Number;
		public var track:BeatGameTrack;
		public var reason:String;
		
		public function BeatGameEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) 
		{ 
			super(type, bubbles, cancelable);
		} 
		
		public override function clone():Event 
		{
			var e:BeatGameEvent = new BeatGameEvent(type, bubbles, cancelable);
			e.engine		= this.engine;
			e.song			= this.song;
			e.note			= this.note;
			e.hitTimeDelta	= this.hitTimeDelta;
			e.track			= this.track;
			e.reason		= this.reason;
			
			return e;
		} 
		
		public override function toString():String 
		{ 
			return formatToString("BeatGameEvent", "type", "engine", "song", "note", "hitTimeDelta", "reason");
		}
		
	}
	
}